<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>查询参数</title>
</head>

<body>
  <!-- 
    城市列表: http://hmajax.itheima.net/api/city
    参数名: pname
    值: 省份名字
  -->
  <p></p>
  <button class="btn">点击获取btn</button>
  <script src="https://unpkg.com/axios@0.21.1/dist/axios.min.js"></script>
  <script>
    document.querySelector('.btn').addEventListener('click', () => {
      axios({
        url: 'http://hmajax.itheima.net/api/city',
        params: {
          pname: '湖南省'   //这个由设计的人决定
        }
      }).then((res) => {
        console.log(res);
      })
    })
  </script>
</body>

</html>